package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

/**
 * @Author: QingYingYan
 * @Date: 2025-10-23 16:30
 * @Description:
 */
public interface UserMapper {
    @Select("select * from sky_take_out.user where openid = #{openid}")
    User getOpenid(Object openid);
    @Options(useGeneratedKeys = true, keyProperty = "id")
    @Insert("insert into sky_take_out.user(openid, name) VALUES (#{openid},#{name})")
    void addUser(User user);

    @Select("select * from user where id = #{id}")
    User selectById(Long userId);
}
